/* The SQL Table Layout */
/* Authid | ItemCraft | ItemCraftXP | WeaponCraft | WeaponCraftXP | Agility */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <sqlx>
#include <dprp>

#define PLUGIN "DPRP Skills Mod"
#define VERSION "1.0"
#define AUTHOR "The Mad Hatter"

#define FALSE 0
#define TRUE 1

#define OFF 0
#define ON 1
#define PAUSED 2

/* Structres */
enum SKILLS
{
	ITEMCRAFT,
	ITEMCRAFTXP,
	WEAPONCRAFT,
	WEAPONCRAFTXP,
	AGILITY,
	STRENGTH,
	DEXTERITY,
	
}

enum TIMEOUT
{
	ITEMCREATE,
	ITEMCREATECD,//Time out for creating an item
	WEAPONCREATE,
	WEAPONCREATECD,
	TRAIN,
	TRAINECD,//Time out for Training
}

enum TRAINENUM
{
	RUNNING,
	JUMPING,
	PUNCHING,
	PUNCHCOUNT,
	JUMPCOUNT,
}


	
	




/* SQLx Global variables*/
new Handle:g_SqlHandle

//new g_Error[512]
new g_Query[512]

new g_skillstable[]= "dprp_skills"

/* Misc */
new g_Training[33][TRAINENUM]
new g_Timer[33]

/* Skills and Timeout Related */
new g_Skill[33][SKILLS]
new Float:g_Timeout[33][TIMEOUT]
new Float:g_CoolDown[TIMEOUT]
new g_XP[51][SKILLS]

/* Menus */
new g_trainMENU[] = "dprp_trainMENU"
new g_skillsMENU[] = "dprp_skillsMENU"

new g_keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9













public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	/* Client Commands */
	register_clcmd("say /train","show_trainMENU")
	register_clcmd("say /useskills","show_skillMENU")
	
	/* Menus */
	register_menucmd(register_menuid(g_trainMENU),g_keys,"trainMENU")
	register_menucmd(register_menuid(g_skillsMENU),g_keys,"skillsMENU")
	
	
	
	/* Tasks */
	set_task(30.0,"SaveData",_,_,_,"b")
}

/* SQL Initiation */
public DPRP_Init() {
	g_SqlHandle = DPRP_SqlHandle()
	
	format(g_Query,511,"CREATE TABLE IF NOT EXISTS %s (authid VARCHAR(36),ItemCraft INT(11),ItemCraftXP INT(11),WeaponCraft INT(11),WeaponCraftXP INT(11),Agility INT(11),Strength INT(11))",g_skillstable)
	SQL_ThreadQuery(g_SqlHandle,"IgnoreHandle",g_Query)
}

/* When the Client Connects */
public client_putinserver(id) {
	
	new Authid[32], Data[1]
	get_user_authid(id,Authid,31)
	
	Data[0] = id
	
	format(g_Query,511,"SELECT * FROM %s WHERE authid='%s'",g_skillstable,Authid)
	SQL_ThreadQuery(g_SqlHandle,"LoadClientSkills",g_Query,Data,1)
	
}

/* Loading the Clients Data */
/* Check */
public LoadClientSkills(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) 
{	
	new id = Data[0]
	
	if(SQL_NumResults(Query) < 1)
	{
		new Authid[32]
		get_user_authid(id,Authid,31)
		
		/* Registers the Player since it didnt find him, it sets all his levels to 1, and level expierence to 0*/
		format(g_Query,511,"INSERT INTO %s VALUES('%s','1','0','1','0','1','1')",g_skillstable,Authid)
		SQL_ThreadQuery(g_SqlHandle,"IgnoreHandle",g_Query)
		
		/* Sets His Global Variable LEvels and XP and Timeouts to 0 */
		g_Skill[id][ITEMCRAFT] = 1
		g_Skill[id][WEAPONCRAFT] = 1
		g_Skill[id][AGILITY] = 1
		g_Skill[id][STRENGTH] = 1
		
		g_Skill[id][ITEMCRAFTXP] = 0
		g_Skill[id][WEAPONCRAFTXP] = 0
	} else {
		/* Load There Skills & XP*/
		g_Skill[id][ITEMCRAFT] = SQL_ReadResult(Query,1)
		g_Skill[id][WEAPONCRAFT] = SQL_ReadResult(Query,3)
		g_Skill[id][AGILITY] = SQL_ReadResult(Query,5)
		g_Skill[id][STRENGTH] = SQL_ReadResult(Query,6)
	
		g_Skill[id][ITEMCRAFTXP] = SQL_ReadResult(Query,2)
		g_Skill[id][WEAPONCRAFTXP] = SQL_ReadResult(Query,4)
	}
	
	
	/*Set Timeouts to 0*/
	g_Timeout[id][ITEMCREATE] = 0.0
	g_Timeout[id][TRAIN] = 0.0
	g_Timeout[id][WEAPONCREATE] = 0.0

	
	/* Other Stuff */
	g_Training[id][PUNCHING] = FALSE
	g_Training[id][JUMPING] = FALSE
	g_Training[id][RUNNING] = FALSE
	g_Training[id][PUNCHCOUNT] = 0
	g_Training[id][JUMPCOUNT] = 0
	
	
	
	return PLUGIN_CONTINUE
}

public SaveData()
{
	new Players[32],playersNum,id
	get_players(Players,playersNum)
	
	for(new count = 0; count < playersNum; count++)
	{
		id = Players[count]
		new Authid[32]
		get_user_authid(id,Authid,31)
		
		format(g_Query,511,"UPDATE %s SET ItemCraft='%d' ItemCraftXP='%d' WeaponCraft='%d' WeaponCraftXP='%d' Agility='%d' Strength='%d' WHERE authid='%s'",g_skillstable,g_Skill[id][ITEMCRAFT],g_Skill[id][ITEMCRAFTXP],g_Skill[id][WEAPONCRAFT],g_Skill[id][WEAPONCRAFTXP],g_Skill[id][AGILITY],g_Skill[id][STRENGTH])
		SQL_ThreadQuery(g_SqlHandle,"IgnoreHandle",g_Query)
	}

	return PLUGIN_CONTINUE
}

public DPRP_HudDisplay(id)
{
	static ItemCraft[128], WeaponCraft[128], Agility[128], Strength[128]
	
	format(ItemCraft,127,"Item Craft: Level-%d  XP-%d%%",g_Skill[id][ITEMCRAFT],CalculatePercent(g_Skill[id][ITEMCRAFTXP],g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]))
	format(WeaponCraft,127,"Weapon Craft: Level-%d  XP-%d%%",g_Skill[id][WEAPONCRAFT],CalculatePercent(g_Skill[id][WEAPONCRAFTXP],g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]))
	format(Strength,127,"Strength: %d",g_Skill[id][STRENGTH])
	format(Agility,127,"Agility: %d",g_Skill[id][AGILITY])
		
	DPRP_AddHudItem(id,HUD_SEC," ")
	DPRP_AddHudItem(id,HUD_SEC,">>>Skills<<<")
	DPRP_AddHudItem(id,HUD_SEC,ItemCraft)
	DPRP_AddHudItem(id,HUD_SEC,WeaponCraft)
	DPRP_AddHudItem(id,HUD_SEC,">>>Attributes<<<")
	DPRP_AddHudItem(id,HUD_SEC,Agility)
	DPRP_AddHudItem(id,HUD_SEC,Strength)
	DPRP_AddHudItem(id,HUD_SEC," ")
	if(g_Training[id][PUNCHING] == TRUE) {
		static Punch[128]
		format(Punch,127,"Punch Count: %d",g_Training[id][PUNCHCOUNT])
		DPRP_AddHudItem(id,HUD_SEC,Punch)
	}
	
}

public CalculatePercent(XP,XP_TO_GO)
	return XP * 100 / XP_TO_GO

public client_prethink(id)
{
	if(g_Training[id][PUNCHING] == TRUE)
	{
		if(entity_get_int(id,EV_INT_button) & IN_ATTACK)
		{
			g_Training[id][PUNCHCOUNT]++
		}
	}
	
	if(g_Training[id][JUMPING] == TRUE)
	{
		if(entity_get_int(id,EV_INT_button) & IN_JUMP)
		{
			g_Training[id][JUMPCOUNT]++
		}
	}
}

/* TRAINING MENU STUFF */
public show_trainMENU(id)
{
	new menu[1024]
	format(menu,1023,"What Attribute are you going to train?^n")
	add(menu,1023,"1. Strength^n")
	add(menu,1023,"2. Agility^n")
	add(menu,1023,"3. Dexterity^n^n")
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"trainMENU")
}

public trainMENU(id,keys)
{
	switch (keys)
	{
		case 1: strengthTRAIN(id)
		case 2: agilityTRAIN(id)
		case 3: dexterityTRAIN(id)
		case 0: return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public agilityTRAIN(id)
{
	new Float:Time = halflife_time()
	
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(Time - g_CoolDown[TRAINECD] < g_Timeout[id][TRAIN]) {
		client_print(id,print_chat,"[DPRP] You are too Tired to train right now.")
		return PLUGIN_HANDLED
	}
	
	if(DPRP_GetUserWallet(id) < 200) {
		client_print(id,print_chat,"[DPRP] You dont have enough money to train.")
		return PLUGIN_HANDLED
	}
	
	new origin[3]
	get_user_origin(id,origin)
	
	g_Training[id][RUNNING] = TRUE
	g_Timer[id] = 60
	
	client_print(id,print_chat,"[DPRP] You must Run for 60 seconds. '/quit' to quit your training. START NOW!!!")
	
	set_task(1.0,"agilityTRAINING",id,origin,3)
	
	return PLUGIN_HANDLED
}

public agilityTRAINING(old_origin[3],id)
{
	new origin[3]
	get_user_origin(id,origin)
	
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(g_Training[id][RUNNING]  == FALSE) {
		client_print(id,print_chat,"[DPRP] You have quit your training and you did not gain a level in Agility")
		return PLUGIN_HANDLED
	}
	
	if(get_distance(old_origin,origin) < 22) 
	{
		if(g_Training[id][RUNNING]  == TRUE) 
		{
			client_print(id,print_chat,"[DPRP] Your training has been paused, Start running again to continure")
			g_Training[id][RUNNING]  = PAUSED
		}
		
		set_task(1.0,"agilityTRAINING",id,origin,3)
		
		return PLUGIN_HANDLED
	}
	
	if(get_distance(old_origin,origin) >= 22) 
	{
		if(g_Training[id][RUNNING] == PAUSED)
		{
			client_print(id,print_chat,"[DPRP] Your training has continued.")
			g_Training[id][RUNNING] = 1
		}
		
		if(g_Timer[id] <= 0)
		{
			new Float:Time = halflife_time()
		 	client_print(id,print_chat,"[DPRP] Your Training is done you have grown a level in Agility")
			++g_Skill[id][AGILITY]
			g_Timeout[id][TRAIN] = Time
			return PLUGIN_HANDLED
		}
		
		--g_Timer[id]
		
		set_task(1.0,"agilityTRAINING",id,origin,3)
		
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public strengthTRAIN(id)
{
	
	new Float:Time = halflife_time()
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(Time - g_CoolDown[TRAINECD] < g_Timeout[id][TRAIN]) {
		client_print(id,print_chat,"[DPRP] You are too Tired to train right now.")
		return PLUGIN_HANDLED
	}
	
	if(DPRP_GetUserWallet(id) < 200) {
		client_print(id,print_chat,"[DPRP] You dont have enough money to train.")
		return PLUGIN_HANDLED
	}
	
	if(g_Timeout[id][TRAIN] > 0) {
		client_print(id,print_chat,"[DPRP] Your too tired to train right now. Try back in about %d seconds.", g_Timeout[id][TRAIN])
		return PLUGIN_HANDLED
	}
	
	g_Training[id][PUNCHING] = TRUE
	g_Training[id][PUNCHCOUNT] = 0
	
	client_print(id,print_chat,"[DPRP] You must Punch 60 times inorder to gain a level in Strength.")
	
	set_task(1.0,"strengthTRAINING",id)
	return PLUGIN_HANDLED
}

public strengthTRAINING(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(g_Training[id][PUNCHING] == FALSE) {
		client_print(id,print_chat,"[DPRP] You have quit your training and you did not gain a level in Strength")
		return PLUGIN_HANDLED
	}
	
	if(g_Training[id][PUNCHCOUNT] >= 60)
	{
		new Float:Time = halflife_time()
		g_Skill[id][STRENGTH]++
		g_Training[id][PUNCHING] = FALSE
		g_Training[id][PUNCHCOUNT] = 0
		g_Timeout[id][TRAIN] = Time
		client_print(id,print_chat,"[DPRP] Congrats! You have gained a level in strength.")
		return PLUGIN_HANDLED
	}
	
	set_task(1.0,"strengthTRAINING",id)
	return PLUGIN_HANDLED
}

public dexterityTRAIN(id)
{
	
	new Float:Time = halflife_time()
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(Time - g_CoolDown[TRAINECD] < g_Timeout[id][TRAIN]) {
		client_print(id,print_chat,"[DPRP] You are too Tired to train right now.")
		return PLUGIN_HANDLED
	}
	
	if(DPRP_GetUserWallet(id) < 200) {
		client_print(id,print_chat,"[DPRP] You dont have enough money to train.")
		return PLUGIN_HANDLED
	}
	
	if(g_Timeout[id][TRAIN] > 0) {
		client_print(id,print_chat,"[DPRP] Your too tired to train right now. Try back in about %d seconds.", g_Timeout[id][TRAIN])
		return PLUGIN_HANDLED
	}
	
	g_Training[id][JUMPING] = TRUE
	g_Training[id][JUMPCOUNT] = 0
	
	client_print(id,print_chat,"[DPRP] You must Jump 60 times inorder to gain a level in Dexterity.")
	
	set_task(1.0,"dexterityTRAINING",id)
	return PLUGIN_HANDLED
}

public dexterityTRAINING(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	if(g_Training[id][JUMPING] == FALSE) {
		client_print(id,print_chat,"[DPRP] You have quit your training and you did not gain a level in Strength")
		return PLUGIN_HANDLED
	}
	
	if(g_Training[id][PUNCHCOUNT] >= 60)
	{
		new Float:Time = halflife_time()
		g_Skill[id][DEXTERITY]++
		g_Training[id][JUMPING] = FALSE
		g_Training[id][JUMPCOUNT] = 0
		g_Timeout[id][TRAIN] = Time
		client_print(id,print_chat,"[DPRP] Congrats! You have gained a level in dexterity.")
		return PLUGIN_HANDLED
	}
	
	set_task(1.0,"strengthTRAINING",id)
	return PLUGIN_HANDLED
}

		
	
	
	
	

public show_skillsMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	format(menu,1023,"Which skill are you going to use?^n")
	add(menu,1023,"1. Item Craft^n^n")
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"skillsMENU")
	
	return PLUGIN_HANDLED
}

public skillsMENU(id,keys)
{
	switch (keys)
	{
		case 1: show_itemcraftMENU(id)
		case 0: return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public show_itemcraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	format(menu,1023,"What Item would you like to create?^n")
	
	add(menu,1023,"1. Cigarette	$15^n")
	
	if(g_Skill[id][ITEMCRAFT] >= 3) 
		add(menu,1023,"2. Lockpick	$50^n")
	else
		add(menu,1023,"2. Lockpick	Lvl 3 Required^n")
	
	if(g_Skill[id][ITEMCRAFT] >= 5) 
		add(menu,1023,"3. Lighter	$65^n")
	else
		add(menu,1023,"3. Lighter	Lvl 5 Required^n")
		
	if(g_Skill[id][ITEMCRAFT] >= 8) 
		add(menu,1023,"4. Spray Can	$75^n")
	else
		add(menu,1023,"4. Spray Can	Lvl 8 Required^n")
	
	if(g_Skill[id][ITEMCRAFT] >= 10) 
		add(menu,1023,"5. Flash Light	$150^n")
	else
		add(menu,1023,"5. Flash Light	Lvl 10 Required^n")
	
	if(g_Skill[id][ITEMCRAFT] >= 15) 
		add(menu,1023,"6. Tazer		$250^n")
	else
		add(menu,1023,"6. Tazer		Lvl 15 Required^n")
		
	if(g_Skill[id][ITEMCRAFT] >= 20) 
		add(menu,1023,"7. Flash Bang	$400^n")
	else
		add(menu,1023,"7. Flash Bang	Lvl 20 Required^n")
	
	if(g_Skill[id][ITEMCRAFT] >= 30) 
		add(menu,1023,"8. Steal Axe	$1000^n^n")
	else
		add(menu,1023,"8. Steel Axe	Lvl 30 Required^n^n")
		
	add(menu,1023,"0. Exit Menu")
		
	show_menu(id,g_keys,"itemcraftMENU")
	
	return PLUGIN_HANDLED
}

public itemcraftMENU(id,keys)
{
	new itemID[1]
	new Float:Time = halflife_time()
	
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 15) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			
			DPRP_FindItemId("Cigarette",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a cigarette. You have earned 10 XP.")
			g_Skill[id][ITEMCRAFTXP] += 10
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 15)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 3) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 50) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			
			DPRP_FindItemId("Lockpick",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error i nfetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a Lockpick. You have earned 20 XP.")
			g_Skill[id][ITEMCRAFTXP] += 20
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 50)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 5) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 65) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Lighter",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a Lighter. You have earned 34 XP.")
			g_Skill[id][ITEMCRAFTXP] += 34
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 65)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 8) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 75) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Spray Can",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a Spray Can. You have earned 40 XP.")
			g_Skill[id][ITEMCRAFTXP] += 40
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 75)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 10) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 150) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Flashlight",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a Flash Light. You have earned 56 XP.")
			g_Skill[id][ITEMCRAFTXP] += 56
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 150)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 6:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 15) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 250) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Tazer",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a Tazer. You have earned 72 XP.")
			g_Skill[id][ITEMCRAFTXP] += 72
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 250)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 7:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 20) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 400) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Flashbang",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a FlashBang. You have earned 100 XP.")
			g_Skill[id][ITEMCRAFTXP] += 100
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 400)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 8:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[ITEMCREATECD] < g_Timeout[id][ITEMCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create items so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][ITEMCRAFT] < 30) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this item.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 1000) {
				client_print(id,print_chat,"[DPRP] Sorry you dont have enough money in your wallet to make this item.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Flashbang",itemID,1)
			
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error in fetching the ID of the item.")
				return PLUGIN_HANDLED
			}
			
			client_print(id,print_chat,"[DPRP] You have created a FlashBang. You have earned 150 XP.")
			g_Skill[id][ITEMCRAFTXP] += 150
			
			if(g_Skill[id][ITEMCRAFTXP] >= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT] && g_Skill[id][ITEMCRAFT] != 50) {
				g_Skill[id][ITEMCRAFTXP] -= g_XP[g_Skill[id][ITEMCRAFT]][ITEMCRAFT]
				g_Skill[id][ITEMCRAFT]++
				client_print(id,print_chat,"[DPRP] Congrats! you gave gained a level in ItemCraft")
			}
			
			g_Timeout[id][ITEMCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 1000)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]))
		}
		
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_weaponcraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	new menu[1024]
	format(menu,1023,"Weapon Craft Menu^n")
	add(menu,1023,"1. Pistol^n")
	add(menu,1023,"2. SMG^n")
	add(menu,1023,"3. Shotgun^n")
	add(menu,1023,"4. Rifle^n")
	add(menu,1023,"5. Special Weapon^n^n")
	add(menu,1023,"6. Ammo^n^n")
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"weaponcraftMENU")
	return PLUGIN_HANDLED
}

public weaponcraftMENU(id,keys)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	switch (keys)
	{
		case 1: show_pistolcraftMENU1(id)
		case 2: show_smgcraftMENU(id)
		case 3: show_shotguncraftMENU(id)
		case 4: show_riflecraftMENU(id)
		case 5: show_specialcraftMENU(id)
		case 6: show_ammocraftMENU1(id)
		case 0: return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public show_pistolcraftMENU1(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	format(menu,1023,"Pistol Craft	Page 1^n")
	
	add(menu,1023,"1. Ruger	  	  $50^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 3) {
		add(menu,1023,"2. Five-Seven	  $75^n")
		add(menu,1023,"3. Socom	MK23	  $80^n")
	} else {
		add(menu,1023,"2. Five-Seven	  Lvl 3 Reqiured^n")
		add(menu,1023,"3. Socom MK23	  LVl 3 Required^n")
	}
	
	if(g_Skill[id][WEAPONCRAFT] >= 4)
		add(menu,1023,"4. Glock 18	  $90^n")
	else	
		add(menu,1203,"4. Glock 18	  Lvl 4 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 6) {
		add(menu,1023,"5. Glock 20c	  $100^n")
		add(menu,1023,"6. Akimbo Berettas $105^n")
	} else {
		add(menu,1023,"5. Glock 20c	  Lvl 6 Required^n")
		add(menu,1023,"6. Akimbo Berettas Lvl 6 Required^n")
	}
	
	if(g_Skill[id][WEAPONCRAFT] >= 10)
		add(menu,1023,"7. Golden Colts	  $130^n^n")
	else
		add(menu,1023,"7. Golden Colts	  Lvl 10 Required^n^n")
		
	add(menu,1023,"8. Back To Main Menu^n")
	add(menu,1023,"9. Next Page^n^n")
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"pistolcraftMENU1")
	
	return PLUGIN_HANDLED
}

public pistolcraftMENU1(id,keys)
{		
	new itemID[1]
	new Float:Time = halflife_time()
	
	switch (keys)
	{
		case 1: //Ruger
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
			
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 50) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Ruger MK1",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Ruger MK1.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Ruger MK1. You have earned 8 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 8
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 50)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][WEAPONCRAFT] < 3) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 75) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("FN Five-seveN Tactical",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Five-Seven.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Five-Seven. You have earned 10 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 10
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 75)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
				
			if(g_Skill[id][WEAPONCRAFT] < 3) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 80) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("H&K SOCOM MK23",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Socom MK23.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Socom MK23. You have earned 13 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 13
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 80)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 90) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 4) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("GLOCK-18",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Glock 18.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Glock 18. You have earned 14 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 14
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 90)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 100) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 6) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("GLOCK-20C",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Glock 20c.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Glock 20c. You have earned 18 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 18
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 100)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 6:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 105) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 6) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Akimbo Beretta 92Fs",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created Akimbo Berettas.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Akimbo Berettas. You have earned 19 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 19
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 105)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 7:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 130) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 10) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Golden Colt 1911A1s",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created Golden Colts.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created Golden Colts. You have earned 23 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 23
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 130)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_weaponcraftMENU(id)
		case 9: show_pistolcraftMENU2(id)
		case 0: return PLUGIN_HANDLED
	}
	
	return PLUGIN_HANDLED
}

public show_pistolcraftMENU2(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
				
	new menu[1024]
	format(menu,1023,"Pistol Craft	Page 2^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 12)
		add(menu,1023,"1. Deagle	$175^n")
	else
		add(menu,1023,"1. Deagle	Lvl 12 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 15)
		add(menu,1023,"2. Raging Bull	$200^n^n")
	else
		add(menu,1023,"2. Raging Bull	Lvl 15 Required^n^n")
	
	add(menu,1023,"8. Back^n^n")
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"pistolcraftMENU2")
	
	return PLUGIN_HANDLED
}
	
public pistolcraftMENU2(id,keys)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
		
	new Float:Time = halflife_time()
			
	new itemID[1]
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 175) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 12) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("IMI Desert Eagle",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Deagle.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Deagle. You have earned 37 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 37
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 175)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 200) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 15) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Taurus Raging Bull",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Deagle.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Deagle. You have earned 43 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 43
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 200)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_pistolcraftMENU1(id)
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_smgcraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	new menu[1024]
	
	format(menu,1023,"SMG Craft Menu^n")
	if(g_Skill[id][WEAPONCRAFT] >= 6)
		add(menu,1023,"1. Mini Uzi	$100^n")
	else
		add(menu,1023,"1. Mini Uzi	Lvl 6 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 10)
		add(menu,1023,"2. MP5K		$125^n")
	else
		add(menu,1023,"2. MP5K		Lvl 10 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 12)
		add(menu,1023,"3. Steyr TMP	$135^n")
	else
		add(menu,1023,"3. Steyr TMP	Lvl 12 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 13) 
		add(menu,1023,"4. H&K MP7	$150^n")
	else
		add(menu,1023,"4. H&K MP7	Lvl 13 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 15)
		add(menu,1023,"5. H&K UMP	$165^n")
	else
		add(menu,1023,"5. H&K UMP	Lvl 15 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 17)
		add(menu,1023,"6. H&K MP5SDA5	$200^n^n")
	else
		add(menu,1023,"6. H&K MP5SDA5	Lvl 17 Required^n^n")
		
	add(menu,1023,"8. Back to Main Menu^n^n")
	
	add(menu,1023,"0. Exit")
	
	show_menu(id,g_keys,"smgcraftMENU")
	
	return PLUGIN_HANDLED
}

public smgcraftMENU(id,keys)
{
	
	new Float:Time = halflife_time()
	new itemID[1]
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 100) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 6) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Mini-Uzi",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Mini-Uzi.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Mini-Uzi. You have earned 43 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 18
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 100)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 125) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 10) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("H&K MP5K",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP5K.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP5K. You have earned 24 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 24
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 125)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 135) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 12) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Steyr TMP",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Steyr TMP.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Steyr TMP. You have earned 32 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 32
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 135)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 150) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 13) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("H&K MP7",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP7.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP7. You have earned 36 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 36
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 150)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 165) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 15) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("H&K UMP",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a H&K UMP.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a H&K UMP. You have earned 44 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 44
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 165)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 6:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 200) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 17) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("H&K MP5SDA5",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP5SDA5.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a H&K MP5SDA5. You have earned 55 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 55
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 200)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_weaponcraftMENU(id)
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_shotguncraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	
	format(menu,1023,"Shotgun Craft Menu^n^n")
	if(g_Skill[id][WEAPONCRAFT] >= 8)
		add(menu,1023,"1. Sawed-Off Shotgun	$125^n")
	else
		add(menu,1023,"1. Sawed-Off Shotgun	Lvl 8 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 14)
		add(menu,1023,"2. Benelli M3		$150^n")
	else
		add(menu,1023,"2. Benelli M3		Lvl 14 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 16)
		add(menu,1023,"3. SPAS-12		$175^n")
	else
		add(menu,1023,"3. SPAS-12		Lvl 16 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 19)
		add(menu,1023,"4. Mossberg 500		$215^n")
	else
		add(menu,1023,"4. Mossberg 500		Lvl 19 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 26)
		add(menu,1023,"5. Daewoo USAS-12	$265^n^n")
	else
		add(menu,1023,"5. Daewoo USAS-12	Lvl 26 Required^n^n")
		
	add(menu,1023,"8. Back to Main Menu^n^n")
	add(menu,1023,"0. Exit Menu")
	
	show_menu(id,g_keys,"shotguncraftMENU")
	return PLUGIN_HANDLED
	
}

public shotguncraftMENU(id,keys)
{
	new Float:Time = halflife_time()
	new itemID[1]
	
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 125) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 8) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Sawed-Off Shotgun",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Sawed-Off Shotgun.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Sawed-Off Shotgun. You have earned 37 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 37
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 125)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 150) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 14) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Benelli M3",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Benelli M3.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Benelli M3. You have earned 46 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 46
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 150)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 175) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 16) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("SPAS-12",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a SPAS-12.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a SPAS-12. You have earned 52 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 52
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 175)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 215) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 19) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Mossberg 500",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Mossberg 500.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Mossberg 500. You have earned 60 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 60
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 215)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 265) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 26) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Daewoo USAS-12",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Daewoo USAS-12.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Daewoo USAS-12. You have earned 72 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 72
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 265)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_weaponcraftMENU(id)
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_riflecraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	format(menu,1023,"Rifle Craft Menu^n^n")
	if(g_Skill[id][WEAPONCRAFT] >= 20)
		add(menu,1023,"1. Steyr AUG		$200^n")
	else
		add(menu,1023,"1. Steyr AUG		Lvl 20 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 25)
		add(menu,1023,"2. Colt M4A1		$250^n")
	else
		add(menu,1023,"2. Colt M4A1		Lvl 25 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 30)
		add(menu,1023,"3. Colt M16A4		$250^n")
	else
		add(menu,1023,"3. Colt M16A4		Lvl 30 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 34)
		add(menu,1023,"4. Kalashnikova AK-47	$275^n")
	else
		add(menu,1023,"4. Kalashnikova AK-47	Lvl 34 Required^n")
		
	if(g_Skill[id][WEAPONCRAFT] >= 50)
		add(menu,1023,"5. Barrett M82A1		$400^n^n")
	else
		add(menu,1023,"5. Barrett M82A1		Lvl 45 Required^n^n")
	
	add(menu,1023,"8. Back to Main Menu^n^n")
	add(menu,1023,"0. Exit Menu")
	
	show_menu(id,g_keys,"riflecraftMENU")
	return PLUGIN_HANDLED
}

public riflecraftMENU(id,keys)
{
	new Float:Time = halflife_time()
	new itemID[1]
	
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 200) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 20) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Steyr AUG",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Steyr AUG.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Steyr AUG. You have earned 50 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 50
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 200)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 250) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 25) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Colt M4A1",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Colt M4A1.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Colt M4A1. You have earned 68 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 68
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 250)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 250) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 30) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Colt M16A4",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Colt M16A4.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Colt M16A4. You have earned 68 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 68
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 250)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 275) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 34) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Kalashnikova AK-47",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Kalashnikova AK-47.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Kalashnikova AK-47. You have earned 75 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 75
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 275)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 400) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 45) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Barrett M82A1",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Barrett M82A1.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Barrett M82A1. You have earned 100 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 100
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 400)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_weaponcraftMENU(id)
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_specialcraftMENU(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	
	new menu[1024]
	format(menu,1023,"Special Weapons Craft Menu^n^n")
	if(g_Skill[id][WEAPONCRAFT] >= 3)
		add(menu,1023,"1. Seal Knife		$30^n")
	else
		add(menu,1023,"1. Seal Knife		Lvl 3 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 7)
		add(menu,1023,"2. Combat Knife		$50^n")
	else
		add(menu,1023,"2. Combat Knife		Lvl 7 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 10)
		add(menu,1023,"3. Katana		$100^n")
	else
		add(menu,1023,"3. Katana		Lvl 10 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 45)
		add(menu,1023,"4. U.S. Ordnance M60E3	$350^n")
	else
		add(menu,1023,"4. U.S. Ordnance M60E3	Lvl 40 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 50)
		add(menu,1023,"5. M61 Grenade		$500^n")
	else
		add(menu,1023,"5. M61 Grenade		Lvl 50 Required^n")
		
	add(menu,1023,"8. Back to Main Menu^n^n")
	add(menu,1023,"0. Exit Menu")
	
	show_menu(id,g_keys,"specialcraftMENU")
	return PLUGIN_HANDLED
}

public specialcraftMENU(id,keys)
{
	new Float:Time = halflife_time()
	new itemID[1]
	
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 30) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 3) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Seal Knife",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Seal Knife.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Seal Knife. You have earned 6 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 6
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 30)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 50) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 7) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Combat Knife",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Combat Knife.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Combat Knife. You have earned 12 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 12
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 50)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 100) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 10) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("Katana",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a Katana.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a Katana. You have earned 18 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 18
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 100)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 350) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 40) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("U.S. Ordnance M60E3",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a U.S. Ordnance M60E3.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a U.S. Ordnance M60E3. You have earned 100 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 100
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 350)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create weapons so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 500) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 50) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this Weapon.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("M61 Grenade",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Gun ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created a M61 Grenade.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created a M61 Grenade. You have earned 0 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 0
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 500)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 8: show_weaponcraftMENU(id)
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

public show_ammocraftMENU1(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
	new menu[1024]
	format(menu,1023,"Ammo Craft Menu Page 1^n^n")
	
	add(menu,1023,"1. .22 Hornet Ammo		$5^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 2)
		add(menu,1023,"2. .45 ACP Ammo		$7^n")
	else
		add(menu,1023,"2. .45 ACP Ammo		Lvl 2 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 4)
		add(menu,1023,"3. 5.7mm FN Ammo		$8^n")
	else
		add(menu,1023,"3. 5.7mm FN Ammo		Lvl 4 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 6)
		add(menu,1023,"4. 5.56mm NATO Ammo	$10^n")
	else
		add(menu,1023,"4. 5.56mm NATO Ammo	Lvl 6 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 8)
		add(menu,1023,"5. .454 Casull Ammo	$12^n")
	else
		add(menu,1023,"5. .454 Casull Ammo	Lvl 8 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 10)
		add(menu,1023,"6. .45 ACP Ammo		$12^n")
	else
		add(menu,1023,"6. .45 ACP Ammo		Lvl 10 Required^n")
	
	if(g_Skill[id][WEAPONCRAFT] >= 12)
		add(menu,1023,"7. 10mm Auto Ammo	$13^n^n")
	else
		add(menu,1023,"7. 10mm Auto Ammo	Lvl 12 Required^n^n")
	
	add(menu,1023,"8. Back to Main Menu^n")
	add(menu,1023,"9. Next Page^n^n")
	add(menu,1023,"0. Exit Menu")
	
	show_menu(id,g_keys,"specialcraftMENU")
	return PLUGIN_HANDLED
}

public ammocraftMENU1(id,keys)
{
	new Float:Time = halflife_time()
	new itemID[1]
	
	switch (keys)
	{
		case 1:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 5) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 1) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId(".22 Hornet Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some .22 Hornet Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some .22 Hornet Ammo. You have earned 4 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 4
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 5)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 2:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 7) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 2) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId(".45 ACP Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some .45 ACP Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some .45 ACP Ammo. You have earned 6 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 6
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 7)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 3:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 8) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 4) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("5.7mm FN Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some 5.7mm FN Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some 5.7mm FN Ammo. You have earned 10 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 10
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 8)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 4:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 10) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 6) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("5.56mm NATO Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some 5.56mm NATO Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some 5.56mm NATO Ammo. You have earned 12 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 12
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 10)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 5:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 12) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 8) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId(".454 Casull Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some .454 Casull Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some .454 Casull Ammo. You have earned 14 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 14
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 12)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 6:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 12) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 10) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId(".45 ACP Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some .45 ACP Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some .45 ACP Ammo. You have earned 15 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 15
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 12)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 7:
		{
			if(!is_user_alive(id))
				return PLUGIN_HANDLED
				
			if(Time - g_CoolDown[WEAPONCREATECD] < g_Timeout[id][WEAPONCREATE]) {
				client_print(id,print_chat,"[DPRP] You cant create ammo so quickly.")
				return PLUGIN_HANDLED
			}
			
			if(DPRP_GetUserWallet(id) < 13) {
				client_print(id,print_chat,"[DPRP] You do not have enough money in your wallet.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] < 12) {
				client_print(id,print_chat,"[DPRP] You are not a high enough level to create this type of ammo.")
				return PLUGIN_HANDLED
			}
			
			DPRP_FindItemId("10mm Auto Ammo",itemID[0],1)
			if(itemID[0] == 0) {
				client_print(id,print_chat,"[DPRP] Error fetching Ammo ID. Report to an Admin on this Issue.")
				return PLUGIN_HANDLED
			}
			
			if(g_Skill[id][WEAPONCRAFT] >= 50) {
				client_print(id,print_chat,"[DPRP] You have created some 10mm Auto Ammo.")
			} else {
				client_print(id,print_chat,"[DPRP] You have created some 10mm Auto Ammo. You have earned 17 xp.")
				g_Skill[id][WEAPONCRAFTXP] += 17
			}
			
			if(g_Skill[id][WEAPONCRAFTXP] >= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]) {
				if(++g_Skill[id][WEAPONCRAFT] == 50)
					g_Skill[id][WEAPONCRAFTXP] = 0
				else
					g_Skill[id][WEAPONCRAFTXP] -= g_XP[g_Skill[id][WEAPONCRAFT]][WEAPONCRAFT]
				g_Skill[id][WEAPONCRAFT]++
				client_print(id,print_chat,"[DPRP] You have gained a level in Weapon Craft.")
			}
			
			g_Timeout[id][WEAPONCREATE] = Time
			DPRP_SetUserWallet(id,DPRP_GetUserWallet(id) - 13)
			DPRP_SetUserItemNum(id,itemID[0],DPRP_GetUserItemNum(id,itemID[0]) + 1)
		}
		case 0: return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}
	
	
	
	
		
		
	
	


		
		
		

	
		

	
			
			

		
			
	

		
		
			
			
			

	
	
	
	
	
		



	


































